<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="zh-CN"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	
	<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.js"></script>
	<script type="text/javascript" src="js/bootstrap-modal.js"></script>
	<script type="text/javascript" src="js/bootstrap-transition.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
				
				$("#uploadFile").click(function(){
				    $('#myModal').modal(option);
				});
				$("#btn").click(function(){
					$("#myform").submit();
				});
		});
	</script>
	
</head>
<body class="body">
	
	<%@ include file="include/head.jsp" %>
	
	<div class="container">
	  <div class="row">
		<div class="span3">
			<div style="padding: 8px 0;" class="well">
				<jsp:include page="include/nav.jsp">
					<jsp:param value="file" name="tag"/>
				</jsp:include>
			</div>
		</div>
		<div class="span9">
			
			<a id="uploadFile" href="#myModal" data-toggle="modal" class="btn btn-primary" style="float: right;"><i class="icon-white  icon-share"></i>上传资料</a>
			<!-- 上传资料 -->
			<div class="modal fade" id="myModal" class="modal hide fade" style="display:none;">
				<div class="modal-header">
					<a class="close" data-dismiss="modal">×</a>
					<h3>上传资料</h3>
				</div>
				<div class="modal-body">
					<form action="file.jspx?m=uploadFile&id=${filetypeid }" method="post" id="myform" enctype="multipart/form-data">
				        <fieldset>
				           <div class="control-group">
								<label class="control-label" for="input01">文件名称</label>
								<div class="controls">
									<input type="text" name="name" class="span6" id="input01" x-webkit-speech="undefined">
								</div>
				           </div>
						   <div class="control-group">
								<label class="control-label" for="input01"></label>
								<div class="controls">
									<input name="file" type="file" class="span4" id="input01" >
								</div>
				           </div>
				        </fieldset>
			      </form>          
				</div>
				<div class="modal-footer">
					<button type="button" id="btn" class="btn btn-primary" style="margin-left:20px;">上传</button>
					<a class="btn" data-dismiss="modal" href="">关闭</a>
				</div>
			</div>
			<div class="clear"></div>
			
			<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px">
				<li class="active">
					<i class="icon-th"></i><a href="fileshare.jspx">文件夹列表</a>&gt;<a href="#">资料列表</a>
				</li>
				<!--  取消管理员删除文件夹的功能
				<c:if test="${ep.e.zhiwei=='管理员' }">
					<li style="float:right">
						<a href="#" class="link-black" title="删除该文件夹"><i class="icon-trash"></i></a>
					</li>
				</c:if>
				-->
			</ul>
			<div class="wall">
				<c:choose>
					<c:when test="${empty page.result}">
						该文件夹中暂时还没有资料！
					</c:when>
					<c:otherwise>
					  <table class="table table-striped">
						<thead>
							<tr>
								<th width="30px"></th>
								<th width="30%">名称</th>
								<th width="20%">大小</th>
								<th width="20%">创建时间</th>
								<th>创建人</th>
								<th></th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${page.result }" var="file">
								<tr>
									<td>
										<img src="img/file.png">
									</td>
									<td><a href="file.jspx?m=download&name=${file.name }&urlname=${file.urlname}">${file.name }</a></td>
									<td>${file.filesize }</td>
									<td>${file.createtime }</td>
									<td>${file.e.name }</td>
									<c:if test="${ep.e.zhiwei=='管理员' }">
										<td>
											<a href="file.jspx?m=deleFile&filetypeid=${filetypeid }&fileid=${file.id}" title="删除文件"><i class="icon-trash"></i></a>
										</td>
									</c:if>
								</tr>
							</c:forEach>
							
						
							</tbody>
						</table>
							<div  style="margin-bottom:20px;height:30px;">
								<jsp:include page="include/pager.jsp">
									<jsp:param value="${page}" name="page"/>
									<jsp:param value="file.jspx" name="jspx"/>
									<jsp:param value="${filetypeid }" name="filetypeid"/>
								</jsp:include>
							</div>
					</c:otherwise>
				</c:choose>
			<hr>
			<span ><a href="fileshare.jspx">←返回</a></span>
		</div>
	  </div>
	</div>

</body></html>
